<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
$return['tpltypes']=array('0'=>'餐饮行业','1'=>'IT科技');
$return['tplkfs']=array('0'=>'客户通知模板','1'=>'店员通知模板');
if($_RQ['op']=='edit'){
	$item1=$this->plugin_setting('basic');
	$item2=$this->plugin_setting('message_tpl');
	$item=array_merge($item1,$item2);
	$footernav =array(
		array('title'=>'首页','icon'=>'icon-shouye','action'=>'jy_qiuyuyue/index/'),
		array('title'=>'场馆','icon'=>'icon-dianpu','action'=>'jy_qiuyuyue/storelist/'),
		array('title'=>'项目','icon'=>'icon-favorite','action'=>'jy_qiuyuyue/serverlist/'),
		array('title'=>'预定','icon'=>'icon-clock','action'=>'jy_qiuyuyue/server_order/'),
		array('title'=>'我的','icon'=>'icon-wo1','action'=>'jy_qiuyuyue/myhome/'),
	);
	$tags='手法有力|手法柔和|疏通经络|微笑服务|贴心服务|积极乐观|提神醒脑|认真负责';
	$bankuai1 =array(
		array('title'=>'项目','img'=>'../addons/jy_weishop/resource/images/new_icon.png','action'=>'jy_qiuyuyue/serverlist/'),
		array('title'=>'积分','img'=>'../addons/jy_weishop/resource/images/yushou2.png','action'=>'jy_qiuyuyue/serverlist//type=3'),
		array('title'=>'预定','img'=>'../addons/jy_weishop/resource/images/yushou.png','action'=>'jy_qiuyuyue/server_order/'),
		array('title'=>'次卡','img'=>'../addons/jy_weishop/resource/images/miaosha.png','action'=>'jy_qiuyuyue/serverlist//type=2'),
		array('title'=>'买单','img'=>'../addons/jy_weishop/resource/images/tejia.png','action'=>'jy_qiuyuyue/order_show/'),
	);
	$my_days = array(
			array('title'=>'场馆订单','icon'=>'icon-quanbudingdan','color'=>'#cc99ff','action'=>'jy_qiuyuyue/order_show/'),
			array('title'=>'积分商城','icon'=>'icon-dianpu','color'=>'#cc99ff','action'=>'jy_creditshop/index/'),
			array('title'=>'我的优惠券','icon'=>'icon-youhuiquan','color'=>'#cc99ff','action'=>'jy_weishop/coupon.myindex/'),
			array('title'=>'地址管理','icon'=>'icon-position','color'=>'#cc99ff','action'=>'core/member.address/'),
			array('title'=>'推广二维码','icon'=>'icon-help','color'=>'#cc99ff','action'=>'jy_commission/qrcode/main/'),
			array('title'=>'分销入口','icon'=>'icon-qiangdan','color'=>'#cc99ff','action'=>'jy_commission/index/'),
	);
	$item['my_days'] = !empty($item['my_days']) ? $item['my_days'] : $my_days;
	$item['demomy_days'] = $my_days;
	$my_logs = array(
			array('title'=>'积分日志','icon'=>'icon-jifen','color'=>'#cc99ff','action'=>'core/member.credit_log/'),
			array('title'=>'余额日志','icon'=>'icon-jiangjiatongzhi','color'=>'#cc99ff','action'=>'core/member.credit_log/'),
			array('title'=>'提现日志','icon'=>'icon-trade','color'=>'#cc99ff','action'=>'core/member.cash_log/'),
			array('title'=>'红包日志','icon'=>'icon-ai-hongbao','color'=>'#cc99ff','action'=>'core/member.red_log/'),
	);
	$item['my_logs'] = !empty($item['my_logs']) ? $item['my_logs'] : $my_logs;
	$item['demomy_logs'] = $my_logs;
	$item['bankuai1'] = !empty($item['bankuai1']) ? $item['bankuai1'] : $bankuai1;
	$item['demobankuai1'] = $bankuai1;
	$item['demofooternav'] = $footernav;
	$item['bankuai2'] = !empty($item['bankuai2']) ? $item['bankuai2'] : $bankuai2;
	$plugins =$this->plugins();
    $return['item']=$item;
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$return['item']['tags']=$return['item']['tags']?$return['item']['tags']:$tags;
	$return['item']['plugins']=$return['item']['plugins']?$return['item']['plugins']:$plugins[1]['list'];
	$return['item']['searchkeyword']=$return['item']['searchkeyword']?:'五人足球|七人足球';
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'系统设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本参数',
				'list'=>array(
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					array('type'=>'unitstring','unit'=>'个','title'=>'首页显示场馆个数','name'=>'limit'),
					array('type'=>'switch','title'=>'关闭显示商家服务','name'=>'no_storebankuai','help'=>'关闭后，场馆详情页，商家服务栏不显示！'),
					array('type'=>'switch','title'=>'关闭显示积分商城？','name'=>'no_jifen','help'=>'关闭后，前端首页不显示积分商城信息！'),
					array('type'=>'string','title'=>'首页商家称呼','name'=>'storecall','help'=>'默认是：《商家》，可以改成《场馆》'),
					array('type'=>'switch','title'=>'开启半场？','name'=>'is_ban','help'=>'全场已经预定了，就不可以再预定半场；半场可以预定两次，有人预定半场，就不可以预定全场'),
					//array('name'=>'tags','title'=>'标签集','type'=>'text','help'=>'每个标签用|隔开；'),
					array('name'=>'invoice','title'=>'开启发票？','type'=>'switch','isradio'=>1,'help'=>$_SESSION['isfounder']?'需安装《在线开发票》插件（仅超级管理员可见）':''),
					array('type'=>'text','title'=>'热门搜索','name'=>'searchkeyword','help'=>'用|隔开，例如：五人足球|七人足球'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
					'title'=>'预约/退款设置',
					'list'=>array(
						array('type'=>'switch','title'=>'只能预约一天以后？','name'=>'no_yueday','help'=>'明天以后的才能预约，当天时间的不能预约！'),
						array('type'=>'switch','title'=>'支持退款？','name'=>'refundopen'),
						array('type'=>'switch','title'=>'不支持当天退款？','name'=>'no_daytui','help'=>'预约明天以后的才能申请退款'),
						array('type'=>'string','title'=>'退款前一天订单扣手续费？','name'=>'fee_daytui','help'=>'可以填固定金额或%；只有预约时间是前一天的订单才扣费,不填则不扣'),
					)
			),
			/*array(
					'title'=>'首页风格',
					'list'=>array(
						array('type'=>'tip','title'=>'【温馨提示】：默认是新风格模式，可以自由切换成老的风格！'),
						array('type'=>'radio_tpl','title'=>'首页风格','name'=>'index_tpl','options'=>'index_tpls'),
					)
			),*/
			array(
					'title'=>'自定义文字',
					'list'=>array(
						array('type'=>'string','title'=>'场馆项目菜单（命名）','name'=>'severtab_title'),
						array('type'=>'string','title'=>'优惠次卡菜单（命名）','name'=>'timetab_title'),
						array('type'=>'string','title'=>'积分商城菜单（命名）','name'=>'jifentab_title'),
					)
			),
			array(
					'title'=>'广告设置',
					'list'=>array(
						array('type'=>'image','title'=>'首页横幅广告1','name'=>'indexad01'),
						array('type'=>'link','from'=>'action','title'=>'首页横幅广告1链接','name'=>'indexad01url'),
						array('type'=>'image','title'=>'首页横幅广告2','name'=>'indexad02'),
						array('type'=>'link','from'=>'action','title'=>'首页横幅广告2链接','name'=>'indexad02url'),
						array('type'=>'image','title'=>'首页横幅广告3','name'=>'indexad03'),
						array('type'=>'link','from'=>'action','title'=>'首页横幅广告3链接','name'=>'indexad03url'),
						array('type'=>'image','title'=>'首页横幅广告4','name'=>'indexad04'),
						array('type'=>'link','from'=>'action','title'=>'首页横幅广告4链接','name'=>'indexad04url'),
					)
			),
			/*array(
				'title'=>'消息模版',
				'list'=>array(
					array('type'=>'switch','title'=>'是否开启模板消息','name'=>'istpl','help'=>'关闭则发送客服消息！(温馨提示：客服消息48小时内，客户必须跟公众号存在交互行为，比如发送消息给公众号，否则不推送信息！)'),
					array('type'=>'radio','title'=>'行业类型','name'=>'tpltype', 'options'=>'tpltypes'),
					array('type'=>'radio','title'=>'模板消息类型','name'=>'tplkf', 'options'=>'tplkfs'),
					array('type'=>'string','title'=>'叫号消息模版','name'=>'call','show'=>array('tplkf','0'),'help'=>'a.餐饮行业在模板库选择行业餐饮－餐饮，搜索“排号通知”编号为OPENTM383288748的模板</br>b.IT科技行业在模板库选择行业IT科技－互联网|电子商务，搜索“排号提醒通知”编号为OPENTM205984119的模板'),
					array('type'=>'string','title'=>'队列更新消息模版','name'=>'queue_update','show'=>array('tplkf','0'),'help'=>'a.餐饮行业在模板库选择行业餐饮－餐饮，搜索“呼叫服务员提醒”编号为OPENTM400182254的模板</br>b.IT科技行业在模板库选择行业IT科技－互联网|电子商务，搜索“服务状态提醒”编号为OPENTM401684051的模板'),
					array('type'=>'string','title'=>'呼叫服务员','name'=>'waiter','show'=>array('tplkf','0'),'help'=>'a.餐饮行业在模板库选择行业餐饮－餐饮，搜索“呼叫服务员提醒”编号为OPENTM400182254的模板</br>b.IT科技行业在模板库选择行业IT科技－互联网|电子商务，搜索“服务状态提醒”编号为OPENTM401684051的模板'),
					array('type'=>'string','title'=>'订单状态变更','name'=>'order_change','show'=>array('tplkf','0'),'help'=>'a.餐饮行业在模板库选择行业餐饮－餐饮，搜索“订单状态提醒”编号为OPENTM202045454的模板,</br>b.IT科技行业在模板库选择行业IT科技－互联网|电子商务，搜索“订单状态提醒”编号为OPENTM206848054的模板'),
					array('type'=>'string','title'=>'新订单通知','name'=>'order_new','show'=>array('tplkf','0'),'help'=>'a.餐饮行业-选择行业餐饮－餐饮，搜索“下单成功提醒”编号为OPENTM414289847'),
					array('type'=>'string','title'=>'订单付款通知','name'=>'order_pay','show'=>array('tplkf','0'),'help'=>'a.餐饮行业-选择行业餐饮－餐饮，搜索“订单状态提醒”编号为OPENTM202045454'),
					array('type'=>'string','title'=>'自取下单通知','name'=>'salf_order_new','show'=>array('tplkf','0'),'help'=>'a.餐饮行业-选择行业餐饮－餐饮，搜索“下单成功通知”编号为OPENTM405555608'),
					array('type'=>'string','title'=>'取餐成功通知','name'=>'qu_order','show'=>array('tplkf','0'),'help'=>'a.餐饮行业-选择行业餐饮－餐饮，搜索“取餐成功通知”编号为OPENTM410712268'),
					array('type'=>'string','title'=>'预定成功通知','name'=>'yuding_order_new','show'=>array('tplkf','0'),'help'=>'a.餐饮行业-选择行业餐饮－餐饮，搜索“预定成功通知”编号为OPENTM207497714'),
					array('type'=>'string','title'=>'店员-订单付款通知','name'=>'kf_order_pay','show'=>array('tplkf','1'),'help'=>'a.餐饮行业-选择行业餐饮－餐饮，搜索“订单状态提醒”编号为OPENTM202045454；</br>b.IT科技行业在模板库选择行业IT科技－互联网|电子商务，搜索“餐饮支付成功通知”编号为OPENTM207696129的模板'),
					array('type'=>'string','title'=>'店员-新订单通知','name'=>'kf_order_new','show'=>array('tplkf','1'),'help'=>'a.餐饮行业-选择行业餐饮－餐饮，搜索“新订单通知”编号为OPENTM203405336；</br>b,IT科技行业搜索“新订单通知”编号为：OPENTM203353600'),
					array('type'=>'string','title'=>'服务员被呼叫','name'=>'kf_waiter','show'=>array('tplkf','1'),'help'=>'a.餐饮行业在模板库选择行业餐饮－餐饮，搜索“呼叫服务员提醒”编号为OPENTM400182254的模板</br>b.IT科技行业在模板库选择行业IT科技－互联网|电子商务，搜索“服务状态提醒”编号为OPENTM401684051的模板'),
					
				)
			),*/
			array(
				'title'=>'幻灯片',
				'list'=>array(
					array(
						'type'=>'array',
						'name'=>'hdps',
						'add_tip'=>'添加一个幻灯片',
							'list'=>array(
								array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片'),
								array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
								
							),
							'details'=>array(
								array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片','help'=>''),
								array('type'=>'link','from'=>'action','name'=>'url','title'=>'幻灯片链接'),
								
							)
				),
				)
			),
			array(
				'title'=>'板块导航1',
				'list'=>array(
						array('type'=>'updemo','name'=>'bankuai1','demo'=>'demobankuai1','title'=>'重置导航','help'=>'不知道添加什么导航？重置默认的一下试试！'),
						array('type'=>'array','name'=>'bankuai1','add_tip'=>'添加一个板块导航',
						'list'=>array(
							array('type'=>'string','name'=>'title','title'=>'导航名称'),
							array('type'=>'image','name'=>'img','title'=>'导航图片'),
							array('type'=>'string','name'=>'action','title'=>'导航链接'),
							//array('type'=>'string','name'=>'pageurl','title'=>'小程序页面'),
							array('type'=>'radio','name'=>'is_install','title'=>'是否关闭','options'=>'is_installs'),											
						),
						'details'=>array(
							array('type'=>'string','name'=>'title','title'=>'导航名称'),
							array('type'=>'image','name'=>'img','title'=>'导航图片'),							
							array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
							//array('type'=>'choose','op'=>'wxappplugins','name'=>'pageurl','title'=>'小程序页面'),	
							array('type'=>'switch','name'=>'is_install','title'=>'是否关闭'),
						)
					),
				)
			),
			array(
				'title'=>'板块导航2',
				'list'=>array(
					array('type'=>'array','name'=>'bankuai2','add_tip'=>'添加一个板块导航',
						'list'=>array(
							array('type'=>'string','name'=>'title','title'=>'导航名称'),
							array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航icon'),
							array('type'=>'color','name'=>'color', 'title'=>'导航颜色'),
							array('type'=>'string','name'=>'action','from'=>'action','title'=>'导航链接'),
							//array('type'=>'string','name'=>'pageurl','title'=>'小程序页面'),
							array('type'=>'radio','name'=>'is_install','title'=>'是否关闭','options'=>'is_installs'),								
						),
					'details'=>array( 
							array('type'=>'string','name'=>'title','title'=>'导航名称'),
							array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航icon'),
							array('type'=>'color','name'=>'color','title'=>'导航颜色'),										
							array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
							//array('type'=>'choose','op'=>'wxappplugins','name'=>'pageurl','title'=>'小程序页面'),
							array('type'=>'switch','name'=>'is_install','title'=>'是否关闭'),
						)
					),
				)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
									array('type'=>'updemo','name'=>'footernav','demo'=>'demofooternav','title'=>'重置导航','help'=>'不知道添加什么导航？重置默认的一下试试！'),
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
			array(
					'title'=>'会员中心页面开关设置',
					'list'=>array(
						array('type'=>'switch','title'=>'关闭我的订单','name'=>'no_order'),
						array('type'=>'switch','title'=>'关闭我的日常','name'=>'no_days'),
						array('type'=>'updemo','name'=>'my_days','demo'=>'demomy_days','title'=>'重置我的日常','help'=>'不知道添加什么我的日常？重置默认的一下试试！'),
						array('type'=>'array','title'=>'我的日常','name'=>'my_days','add_tip'=>'添加一个我的日常',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'日常名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'日常图标'),
										array('type'=>'string','name'=>'action','title'=>'日常链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'日常名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'日常图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'日常链接'),
									)
						),
						array('type'=>'switch','title'=>'关闭我的记录','name'=>'no_logs'),
						array('type'=>'updemo','name'=>'my_logs','demo'=>'demomy_logs','title'=>'重置我的记录','help'=>'不知道添加什么我的记录？重置默认的一下试试！'),
						array('type'=>'array','title'=>'我的记录','name'=>'my_logs','add_tip'=>'添加一个我的记录',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'记录名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'记录图标'),
										array('type'=>'string','name'=>'action','title'=>'记录链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'记录名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'记录图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'记录链接'),
									)
						),
					)
				),
			),
	);
	$return['index_tpls']=array(
		array('id'=>0,'title'=>'A2风格','image'=>'../addons/jy_qiuyuyue/resource/images/tpl02.png'),
		array('id'=>1,'title'=>'A1风格','image'=>'../addons/jy_qiuyuyue/resource/images/tpl01.png'),
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$this->plugin_setting('basic',$postdata);
	exi('设置成功');
}
?>